﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoyoEden.Models;

namespace CoyoEden.Web.Controls
{
	public class AlbumViewBase:ViewBase
	{
		#region member variables
		public Album TheAlbum
		{
			get;
			set;
		}
		public List<PortalFile> Pics { get; set; }
		public string AlbumLogo {
			get {
				var defaultLogo = "~/assets/img/unkown80x80.gif";
				if (TheAlbum.Pics.Count > 0) {
					defaultLogo = TheAlbum.Pics[0].Url;
					defaultLogo = string.Format("{0}&suffix={1}",defaultLogo,"80x80");
				}
				defaultLogo = Utils.ConvertToAbsolute(defaultLogo).ToString();
				return defaultLogo;
			}
		}
		public string AlbumUrl {
			get {
				if (TheAlbum.Id <0) return "#";
				var url = Utils.AbsoluteWebRoot.ToString() + "Album/"+TheAlbum.Id.ToString()+".aspx";
				return url;
			}
		}
		#endregion

		#region Properties Used By AlbumPicsView.ascx
		public string CssClass { get; set; }
		public int PicWidth { get; set; }
		public int PicHeight { get; set; }
		public bool ShowAdminLinks { get; set; }
		#endregion
	}
}
